#!/usr/bin/env php
<?php
function main()
{
    try
    {
        $client=new SoapClient("http://sample/soap/server.php?wsdl");
        //$client=new SoapClient("http://sample/soap/server.wsdl");
        //$client=new SoapClient(null,
        //        array('location'=>'http://sample/soap/server.php',
        //            'uri'=>'http://sample/soap'));
        var_dump($client->__getFunctions());
        var_dump($client->__getTypes());
        $response=$client->Hello('你好');
        print_r($response);
        echo "\n";
    }
    catch(SoapFault $e)
    {
        printf("Error: %s\n", $e->getMessage());
    }
}

$code=main();
exit($code);
?>
